package com.study.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;

/**
 * EncodingController class
 *
 * @author chenyeqing
 * @date 2021/3/23
 */
@Controller
public class EncodingController {

    @PostMapping("/e/t1")
    public String test01(@RequestParam("username") String name, Model model) {
        System.out.println("接收到的参数" + name);
        model.addAttribute("msg", name);
        return "test";
    }

    @PostMapping("/e/t2")
    public String test02(@RequestParam("username") String name, Model model) {
        System.out.println("接收到的参数" + name);
        model.addAttribute("msg", name);
        return "test";
    }
}
